<template>
  <PageBox :data="dataInfo" :isSelect="isSelect" :isCheckbox="isCheckbox" @tableRadioBtn="tableRadioBtn"
    @tableCheckboxBtn="tableCheckboxBtn" @searchBtn="getTbody">
    <template #search="{ search }">
      <ElFormItemBox label="启用状态" prop="isShowDisabled">
        <ElSelectBox :data="search" dataName="isShowDisabled" isAll :allValue="-1" :options="options.disabledState" />
      </ElFormItemBox>
      <ElFormItemBox label="刀模状态" prop="knifeVersionState">
        <ElSelectBox :data="search" dataName="knifeVersionState" isAll :allValue="-1"
          :options="options.knifeVersionState" />
      </ElFormItemBox>
    </template>
    <template #isDisable="{ row }">
      <ElTagBox :data="row.isDisable" :options="options.disabledState" />
    </template>
    <template #knifeVersionState="{ row }">
      <ElTagBox :data="row.knifeVersionState" :options="options.knifeVersionState" />
    </template>
  </PageBox>
</template>

<script setup lang="ts">
import './pageCss.scss'; // 引入样式
import { useListComponent } from './pageTs'; // 引入逻辑
const { dataInfo, getTbody, options } = useListComponent();
const props = withDefaults(
  defineProps<{
    isSelect?: boolean;//是否是选择页面
    isCheckbox?: boolean;//是否多选
  }>(),
  {

  },
);
const emit = defineEmits<{
  //fn为父组件引入子组件是定义的子组件事件属性，可随意定义
  (event: 'tableRadioBtn', row: any): void;
  (event: 'tableCheckboxBtn', arr: any): void;
}>();
//多选数据
const tableCheckboxBtn = (arr: any) => {
  emit('tableCheckboxBtn', arr);
};
//单选数据
const tableRadioBtn = (row: any) => {
  emit('tableRadioBtn', row);
};
</script>
